<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>

</body>

<script>
  window.onload = function () {
    let x = [1, 2, 3]
    let y = x
    let z = [4, 5, 6]
    y[0] = 10  // x: [10, 2, 3], y: [10, 2, 3]
    y = z  // y: [4, 5, 6], z: [4, 5, 6]
    z[1] = 20  // y: [4, 20, 6], z: [4, 20, 6]
    x[2] = z = 30  // x: [10, 2, 30], z: 30
    console.log(x, y, z)  // x: [10, 2, 30], y: [4, 20, 6], z: 30
  }
</script>

</html>
